Python Week #2¶

Importing Libraries which are necessary :¶

  • Intoduced Libraries :
  • math
  • numpy
  • matplotlib.pyplot
  • plotly.express
  • pandas
In [1]:
import numpy as np
import math as m
import matplotlib.pyplot as plt
import plotly.express as px
import pandas as pd

Plotting points on graph using numpy , linspace¶

In [5]:
x = np.linspace(-2*np.pi,2*np.pi,1000);
y = np.sin(x)
plt.plot(x,y)
Out[5]:
[<matplotlib.lines.Line2D at 0x2e98bccd510>]
In [2]:
import plotly.express as px
df = px.data.gapminder()
fig = px.line(df, x="year", y="lifeExp", color="continent", line_group="country", hover_name="country",
        line_shape="spline", render_mode="svg")
fig.show()